<?php
/**
 * Created by PhpStorm.
 * User: taoguliuxian
 * Date: 2020/4/16
 * Time: 15:17
 */

$link=mysqli_connect('localhost','root','root','weixiblog');

if($link){
    $sql="select * from post order by id desc";
    $res=mysqli_query($link,$sql);
    //print_r($res);
    echo "<table border='1'><th>标题</th><th>内容</th><th>作者</th>";
    while ($data=mysqli_fetch_array($res)){
        $str=<<<EOR
<tr><td>{$data['title']}</td>
<td width="500">{$data['content']}</td>
<td>{$data['author_id']}</td>
</tr>
EOR;
        echo $str;
    }
    echo "</table>";


}